﻿<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Equipment</title>
	<link rel="stylesheet" href="../js/easyui/themes/bootstrap/easyui.css">
	<link rel="stylesheet" href="../js/easyui/themes/icon.css">
	<link rel="stylesheet" href="../js/easyui/themes/color.css">
	<link rel="stylesheet" href="../css/index.css" />
	<link rel="stylesheet" href="../css/index-ui.css" />
	<script type="text/javascript" src="../js/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../js/ams.util.js"></script>
	<script type="text/javascript" src="../js/webapi.js"></script>
	<script type="text/javascript" src="../js/ui_eq_recipe.js"></script>
</head>

<body onload="on_page_load()">
	<div id="rcp_layout_main" class="easyui-layout cls_rcp_layout_main">
		<div data-options="region:'west',split:true" title="Equipment Recipe" style="width:500px;">
			<div id="toolbar_eq">
				<!-- <a class="easyui-linkbutton" iconCls="icon-search" onclick="on_rcp_open('eq')">View</a> -->
				<a class="easyui-linkbutton" style="width:72px" iconCls="icon-view" onclick="on_rcp_open('eq')">View</a>
				<a class="easyui-linkbutton" id="btn_refresh_eq_rcp" iconCls="icon-reload" onclick="on_refresh_rcp_list('eq')">Refresh</a>
				<!-- <a class="easyui-linkbutton" iconCls="icon-search" onclick="on_upload_rcp()">Upload</a>
				<a class="easyui-linkbutton" iconCls="icon-search" onclick="on_compare_rcp('eq')">Compare</a> -->
				<a class="easyui-linkbutton" iconCls="icon-next" onclick="on_upload_rcp(false)">Upload</a>
				<a class="easyui-linkbutton" iconCls="icon-compare" onclick="on_compare_rcp('eq')">Compare</a>
				<a class="easyui-linkbutton" id="btn_on_dummy_rcp" iconCls="icon-dummy" onclick="on_dummy_rcp('eq')">Dummy</a>
				<select class="easyui-combobox" id="rcp-group-equ" name="state" style="width:89px;" editable="false" panelHeight="auto">
					<option value="MANUAL">MANUAL</option>
					<option value="PRODUCT">PRODUCT</option>
				</select>
				<br>
				<div id='eq_rcp_tabs' class="easyui-tabs" style="width:700px;height:640px">
					<div id="eq_file_context_menu" class="easyui-menu" style="width:120px;">
						<div onclick="BatchUpload()" data-options="iconCls:'icon-next'">Batch Upload</div>
					</div>
					<div title="Process" style="padding:10px">
						<table id='eq_rcp_proc'
							title="Process" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>
					<div title="Unit" style="padding:10px">
						<table id='eq_rcp_unit'
							title="Unit" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>
					<div title="Pump" style="padding:10px">
						<table id='eq_rcp_pump'
							title="pump" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>	
				</div>
			</div>
		</div>
		<div data-options="region:'center'" title="Server Recipe" style="width:550px;">
			<div id="toolbar_server">
				<!-- <a class="easyui-linkbutton" id="btn_view_server_rcp" style="width:70px" iconCls="icon-search" onclick="on_rcp_open('server')">Open</a> -->
				<a class="easyui-menubutton" style="width:90px" data-options="menu:'#mm1',iconCls:'icon-filter',toggle:true,group:'g1',plain:false">Edit</a>
				<!--<a class="easyui-linkbutton" id="btn_view_server_rcp" style="width:77px" iconCls="icon-open" onclick="on_rcp_open('server')">Open</a>-->
				<a class="easyui-linkbutton" id="btn_refresh_server_rcp" iconCls="icon-reload" onclick="on_refresh_rcp_list('server')">Refresh</a>
				<!--<a class="easyui-linkbutton" id="btn_new_server_rcp" style="width:65px" iconCls="icon-add" onclick="on_rcp_new()">New</a>-->
				<!--<a class="easyui-linkbutton" id="btn_delete_server_rcp" iconCls="icon-cancel" onclick="on_rcp_delete()">Delete</a>-->
				<!-- <a class="easyui-linkbutton" id="btn_compare_server_rcp" iconCls="icon-search" onclick="on_compare_rcp('server')">Compare</a> -->
				<a class="easyui-linkbutton" id="btn_compare_server_rcp" iconCls="icon-compare" onclick="on_compare_rcp('server')">Compare</a>
				<a class="easyui-linkbutton" id="btn_download_server_rcp" style="width:90px" iconCls="icon-back" onclick="on_rcp_download()">Download</a>
				<select class="easyui-combobox" id="rcp-group-svr" name="state" style="width:90px;" editable="false" panelHeight="auto">
					<option value="MANUAL">MANUAL</option>
					<option value="PRODUCT">PRODUCT</option>
				</select>
				<div id='server_rcp_tabs' class="easyui-tabs" style="width:700px;height:640px">
					<div id="server_file_context_menu" class="easyui-menu" style="width:120px;">
						<div onclick="copy()" data-options="iconCls:'icon-copy'">Copy</div>
						<div onclick="rename()" data-options="iconCls:'icon-rename'">Rename</div>
					</div>
					<!-- <div id="server_folder_context_menu" class="easyui-menu" style="width:120px;">
						<div onclick="rename()" data-options="iconCls:'icon-remove'">Rename</div>
					</div> -->
					<div title="Process" style="padding:10px">
						<table id='server_rcp_proc' title="Process" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>
					<div title="Unit" style="padding:10px">
						<table id='server_rcp_unit' title="Unit" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>
					<div title="Pump" style="padding:10px">
						<table id='server_rcp_pump' title="pump" class="easyui-treegrid" style="width:465px;height:640px">
							<thead>
								<tr>
									<th data-options="field:'name'" width="60%">Name</th>
									<th data-options="field:'detail'" width="40%">Detail</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
			</div>
			<div id="mm1" style="width:50px">
			  <div iconCls="icon-open" onclick="on_rcp_open('server')">Open</div>
				<div iconCls="icon-add" onclick="on_rcp_new()">New</div>
				<div iconCls="icon-cancel" onclick="on_rcp_delete()">Delete</div>
	  </div>
		</div>

		<div id="rcp_copy_sel_wnd" class="easyui-window" title="Select a path to copy with"
			data-options="modal:true, closed:true, iconCls:'icon-save',cls:'c1'" style="width:500px;height:480px;padding:10px;">

			<table style="color:#cccccc;border:solid thin #ffffff;font: size 10;">
				<tr>
					<td width="80">Recipe Type:</td>
					<td><label id="path_rcp_subtype"></label></td>
				</tr>
				<tr>
					<td>Path A:</td>
					<td><label id="path_rcp_1" style="color:#0000ff"></label></td>
				</tr>
				<tr>
					<td>Path B:</td>
					<td><label id="path_rcp_2" style="color:#0000ff"></label></td>
				</tr>
			</table>
			<div class="easyui-layout" style="float:left;width:600px;height:310px;">
				<div title="Equipment" data-options="region:'west'"
					style="float:left;width:160px;height:100%;border:1px solid #cccccc">
					<ul id="grp_eq_tree_01" title="Equipment" class="easyui-tree" style="height:200px"></ul>
				</div>

				<div data-options="region:'center'" style="float:left;width:500px;height:100%;padding-left:5px">
					<table id="copy_unit_rcp_list" class="easyui-treegrid" title="Path  (Only folder can be choosed)" lines="true" style="width:300px;height:100%;margin:auto"
						data-options="singleSelect:true">
						<thead>
							<tr>
								<th data-options="field:'name'" width="95%">Name</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
			<br/>
			<div style="width:330px;padding-left:2px">
				<table>
					<tr>
						<td height="50" width="250" align="center">
							<a class="easyui-linkbutton" onclick="do_rcp_copy()" style="width:115px" data-options="iconCls:'icon-save', plain:false">Copy</a>
							<!--a class="easyui-linkbutton" onclick="do_rcp_cmp_cancel()" style="width:180px" data-options="iconCls:'icon-save', plain:false">Cancel</a-->
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div id="rcp_cmp_sel_wnd" class="easyui-window" title="Select a recipe to compare with"
			data-options="modal:true, closed:true, iconCls:'icon-save',cls:'c1'" style="width:500px;height:480px;padding:10px;">

			<table style="color:#cccccc;border:solid thin #ffffff;font: size 10;">
				<tr>
					<td width="80">Recipe Type:</td>
					<td><label id="label_rcp_subtype"></label></td>
				</tr>
				<tr>
					<td>Recipe A:</td>
					<td><label id="label_rcp_1" style="color:#0000ff"></label></td>
				</tr>
				<tr>
					<td>Recipe B:</td>
					<td><label id="label_rcp_2" style="color:#0000ff"></label></td>
				</tr>
			</table>
			<div class="easyui-layout" style="float:left;width:600px;height:310px;">
				<div title="Equipment" data-options="region:'west'"
					style="float:left;width:160px;height:100%;border:1px solid #cccccc">
					<ul id="grp_eq_tree" title="Equipment" class="easyui-tree" style="height:200px"></ul>
				</div>

				<div data-options="region:'center'" style="float:left;width:500px;height:100%;padding-left:5px">
					<table id="cmp_unit_rcp_list" class="easyui-treegrid" title="Recipe" lines="true" style="width:300px;height:100%;margin:auto"
						data-options="singleSelect:true">
						<thead>
							<tr>
								<th data-options="field:'name'" width="95%">Name</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
			<br/>
			<div style="width:330px;padding-left:2px">
				<table>
					<tr>
						<td height="50" width="250" align="center">
							<a class="easyui-linkbutton" onclick="do_rcp_cmp()" style="width:115px" data-options="iconCls:'icon-save', plain:false">Compare</a>
							<!--a class="easyui-linkbutton" onclick="do_rcp_cmp_cancel()" style="width:180px" data-options="iconCls:'icon-save', plain:false">Cancel</a-->
						</td>
						<td>
							<td width="50" height="40"><input id="switch_cmp_sel_loc" class="easyui-switchbutton"></td>
						</td>
					</tr>
				</table>
			</div>
		</div>

		<div id="wnd_rcp_download" class="easyui-window" title="Select a recipe to download"
			data-options="modal:true, closed:true, iconCls:'icon-save',cls:'c1'" style="width:315px;height:315px;padding:10px;">

			<label id="label_dl_rn" style="color:#0000ff;padding-bottom: 5px">{rcp name}</label>

			<div class="easyui-layout cls_rcp_layout_main" style="float:left;width:280px;height: 200px">
				<div data-options="region:'west'"
						style="float:left;width:280px;height:100%;border:1px solid #cccccc">
					<ul id="tree_dl_eq_sel" title="Equipment" class="easyui-tree" style="width:99%;height:99%;border:1px solid #cccccc"
						data-options="checkbox:true"></ul>
				</div>
			</div>

			<div style="float:left;padding-left: 70px;padding-top: 10px">
				<a class="easyui-linkbutton" onclick="on_wnd_btn_download()" style="width:115px"
					data-options="iconCls:'icon-help', plain:false">Download</a>
			</div>

		</div>

		<div id="dlg_rcp_new" class="easyui-dialog" title="New" style="width:300px;height:200px;padding:10px;"
			data-options=" modal:true, closed:true, iconCls:'icon-save',cls:'c7',
				buttons: [{
					text:'OK', iconCls:'icon-ok',
					handler: function(){
						do_new_rcp()
					}
				}]">

			<table style="width:100%">
				<tr>
					<td width="80" style="color:#0000ff">Recipe Type:</td>
					<td><label id="rcp_subtype"></label></td>
				</tr>
				<tr height="20"></tr>
				<tr> 
					<td> <label style="color:#0000ff" id="ec_name">Recipe Name: </label> </td> 
					<td> <input id="input_new_rcp_name" class="easyui-textbox" type="text" value="" style="width:96%" /> </td>
				</tr>							
			</table>

			<div style="margin:10px">
			</div>
		</div>

		<div id="dlg_rcp_rename" class="easyui-dialog" title="Rename" style="width:300px;height:180px;padding:10px;"
			data-options=" modal:true, closed:true, iconCls:'icon-save',cls:'c7',
				buttons: [{
					text:'OK', iconCls:'icon-ok',
					handler: function(){
						do_rename()
					}
				}]">

				<table style="width:100%">
						<tr> <td> <label style="color:#0000ff" id="new_name">New Name: </label> </td> 
							<td>
								<input id="new_rcp_name" class="easyui-textbox" type="text" value="" style="width:96%" />
							</td>
						</tr>

						<tr height="20"></tr>
						<tr>
							<td width="80" style="color:#0000ff">Old name: </td>
							<td><label id="rename_old"></label></td>
						</tr>
				</table>

			<div style="margin:10px">
			</div>
		</div>

		<div id="rcp_cmp_window" class="easyui-window" title="Recipe Comparation"
				data-options="modal:true, closed:true, iconCls:'icon-save',cls:'c1'" style="width:800px;height:400px;padding:10px;">
			<div id="layout_rcp_cmp" class="easyui-layout cls_rcp_layout_main">
				<div id="rgn_rcp_cmp_1" data-options="region:'west',split:true" title="rcp_11" style="width:480px;">
					<div style="float:left;width:300px;height:50px;margin:10px">
						<p> header values </p>
						<p> header values </p>
					</div>
					<table id="grid_rcp_cmp_1" class="easyui-datagrid" style="width:99%;height:66%" iconCls="icon-save"
						data-options="singleSelect:true" rownumbers="false" pagination="false">
					</table>
				</div>
				<div id="rgn_rcp_cmp_2" data-options="region:'center'" title="rcp_2" style="width:480px;">
					<div style="float:left;width:300px;height:50px;margin:10px">
							<p> header values </p>
							<p> header values </p>
					</div>
					<table id="grid_rcp_cmp_2" class="easyui-datagrid" style="width:99%;height:66%" iconCls="icon-save"
						data-options="singleSelect:true" rownumbers="false" pagination="false">
					</table>
				</div>
			</div>
		</div>

		<div id="window_proc_rcp" class="easyui-window" title="Recipe Editor"
			data-options="modal:true,closed:true,iconCls:'icon-help',cls:'c1'" style="width:980px;height:700px;padding:10px;">
			<div id="proc_rcp_edit_btns" class="easyui-panel" style="padding:2px;" align="left">
				<a class="easyui-linkbutton" style="width:80px" data-options="iconCls:'icon-save', plain:true" onclick="on_ed_prcp_save()">Save</a>
				<a class="easyui-linkbutton" style="width:80px" data-options="iconCls:'icon-delete', plain:true" onclick="on_ed_prcp_remove_row()">Remove</a>
				<a class="easyui-linkbutton" style="width:80px" data-options="iconCls:'icon-append', plain:true" onclick="on_ed_prcp_append()">Append</a>
				<a class="easyui-linkbutton" style="width:80px" data-options="iconCls:'icon-insert', plain:true" onclick="on_ed_prcp_insert()">Insert</a>
			</div>

			<table id="table_proc_rcp" style="width:99%;height:88%" rownumbers="false" pagination="false"
				data-options="rownumbers:true">
				<thead>
					<tr>
						<th data-options="field:'u1',width:125,editor:'text'">UNIT1</th>
						<th data-options="field:'u2',width:125">UNIT2</th>
						<th data-options="field:'u3',width:125">UNIT3</th>
						<th data-options="field:'u4',width:125">UNIT4</th>
						<th data-options="field:'u5',width:125">UNIT5</th>
						<th data-options="field:'u6',width:125">UNIT6</th>
						<th data-options="field:'u7',width:125">UNIT7</th>
						<th data-options="field:'u8',width:125">UNIT8</th>
						<th data-options="field:'u9',width:125">UNIT9</th>
						<th data-options="field:'u10',width:125">UNIT10</th>
						<th data-options="field:'u11',width:125">UNIT11</th>
						<th data-options="field:'u12',width:125">UNIT12</th>
						<th data-options="field:'u13',width:125">UNIT13</th>
						<th data-options="field:'u14',width:125">UNIT14</th>
						<th data-options="field:'u15',width:125">UNIT15</th>
						<th data-options="field:'u16',width:125">UNIT16</th>
						<th data-options="field:'u17',width:125">UNIT17</th>
						<th data-options="field:'u18',width:125">UNIT18</th>
						<th data-options="field:'u19',width:125">UNIT19</th>
						<th data-options="field:'u20',width:125">UNIT20</th>
					</tr>
				</thead>
			</table>
			<div id="prcp_tbl_ctx_menu" class="easyui-menu" style="width:120px;">
				<div onclick="on_ed_prcp_edit_cell()">Edit</div>
				<div onclick="on_ed_prcp_remove_cell()">Delete</div>
			</div>
		</div>

		<!-- Process Recipe Value Setting Dialog Box -->
		<div id="proc_rcp_value_dlg" class="easyui-dialog" title="Values" style="width:500px;height:450px;padding:10px;"
			data-options="modal:true, closed:true,cls:'c7'">
			<div style="float:left;margin-left:10px">
				<div id="ed_prcp_eq_unit_list" class="easyui-datalist" title="Unit List" sortable:true lines="true" style="width:145px;height:350px;margin:auto"
					data-options="singleSelect:true">
				</div>
			</div>
			<div style="float:left;margin-left:5px">
				<table id="ed_prcp_eq_urcp_list" class="easyui-treegrid" title="Recipe List" lines="true" style="width:260px;height:350px;margin:auto"
					data-options="singleSelect:true">
					<thead>
						<tr>
							<th data-options="field:'name'" width="95%">Name</th>
						</tr>
					</thead>
				</table>
			</div>
			<div style="width:95%;text-align:center">
				<a class="easyui-linkbutton" style="width:100px;margin-top: 10px" onclick="on_ed_prcp_set_value()" data-options="iconCls:'icon-ok', plain:false">OK</a>
				<a class="easyui-linkbutton" style="width:100px;margin-top: 10px" onclick="on_ed_prcp_cancelt_value()" data-options="iconCls:'icon-cancel', plain:false">Cancel</a>
			</div>
		</div>

		<!-- 20190613 start -->
		<div id="window_dummy" class="easyui-window" title="Dummy_view"
			data-options="modal:true,closed:true,iconCls:'icon-help',cls:'c1'" style="width:980px;height:700px;padding:10px;">
			<div id="rcp_change_btns" class="easyui-panel" style="padding:1px;" align="left">
				<a class="easyui-linkbutton" id="btn_rcp_refresh_dummy" style="width:100px" onclick="on_rcp_dummy_refresh_list()" 
					data-options="iconCls:'icon-save', plain:true">Refresh</a>
			</div>
			<div id="rcp_layout_main" class="easyui-layout" style="	width:930px;height:600px;margin:0 auto;border:1px solid #999;">
				<div id="rcp_dummy_list" class="easyui-datalist" title="Dummy Recipes" style="width:150px;height:400px;margin:auto"
					data-options="region:'west', singleSelect:true">
				</div>
				<div id="dummy_layout" title="" style="width:auto;height:600px" rownumbers="false" pagination="false"
					data-options="region:'center',split:true,rownumbers:true">
					<canvas id="rcp_dummy_canvas" left="50" width="980px" height="600px" background-color="#333333" style="border:0px solid #c3c3c3;">
						Your browser does not support the canvas element.
					</canvas>
				</div>
			</div>
		</div>
		<!-- 20190613 end -->

		<div id="window_unit_rcp" class="easyui-window" title="Recipe Editor"
			data-options="modal:true,closed:true,iconCls:'icon-help',cls:'c1'" style="width:850px;height:600px;padding:10px;">
			<div id="rcp_edit_btns" class="easyui-panel" style="padding:2px;" align="left">
				<a class="easyui-linkbutton" style="width:80px" onclick="on_ed_urcp_save()" data-options="iconCls:'icon-save', plain:true">Save</a>
				<a class="easyui-linkbutton" style="width:80px" onclick="on_ed_urcp_remove_row()" data-options="iconCls:'icon-delete', plain:true">Remove</a>
				<a class="easyui-linkbutton" style="width:80px" onclick="on_ed_urcp_append()" data-options="iconCls:'icon-append', plain:true">Append</a>
				<a class="easyui-linkbutton" style="width:80px" onclick="on_ed_urcp_insert()" data-options="iconCls:'icon-insert', plain:true">Insert</a>
			</div>
			<div style="float:left;width:300px;margin:10px">
				<!-- <table id="table_info" style="color:#cccccc;border:solid thin #cccccc">
					<tr>
						<td width="100">Create:</td>
						<td width="100">OEM-User</td>
						<td width="140">2018/04/24 16:26:22</td>
					</tr>
					<tr>
						<td>Last Update:</td>
						<td>OEM-User</td>
						<td>2018/06/13 09:39:14</td>
					</tr>
					<tr>
						<td>Last Update 2:</td>
						<td>OEM-User</td>
						<td>2018/06/13 09:37:50</td>
					</tr>
				</table> -->
				<table id="table_info" style="color:#cccccc;border:solid thin #cccccc">
					<!-- <tr>
						<td width="100"></td>
						<td width="100"></td>
						<td width="140"></td>
					</tr> -->
					<tr>
						<td width="160" id="urcp_in_1"></td>
						<td width="160" id="urcp_iv_1"></td>
					</tr>
					<tr>
						<td width="160" id="urcp_in_2"></td>
						<td width="160" id="urcp_iv_2"></td>
					</tr>
					<tr>
						<td width="160" id="urcp_in_3"></td>
						<td width="160" id="urcp_iv_3"></td>
					</tr>
					<tr>
						<td width="160" id="urcp_in_4"></td>
						<td width="160" id="urcp_iv_4"></td>
					</tr>
					<tr>
						<td width="160" id="urcp_in_5"></td>
						<td width="160" id="urcp_iv_5"></td>
					</tr>
					<tr>
						<td width="160" id="urcp_in_6"></td>
						<td width="160" id="urcp_iv_6"></td>
					</tr>
				</table>
			</div>
			<div style="float:right;width:450px;margin:10px">
				<table id="table_header">
					<tr height="27" style="padding-bottom:1px">
						<td id="urcp_hn_1" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="urcp_hv_1" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_1()" data-options="plain:true"></a>
						</td>
						<td id="urcp_hn_2" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="urcp_hv_2" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_2()" data-options="plain:true"></a>
						</td>
					</tr>
					<tr height="27" style="padding-bottom:1px">
						<td id="urcp_hn_3" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="urcp_hv_3" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_3()" data-options="plain:true"></a>
						</td>
						<td id="urcp_hn_4" width="102" align="right" style="padding-right:2px">							
						</td>
						<td width="118">
							<a id="urcp_hv_4" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_4()" data-options="plain:true"></a>
						</td>
					</tr>
					<tr height="27" style="padding-bottom:1px">
						<td id="urcp_hn_5" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="urcp_hv_5" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_5()" data-options="plain:true"></a>
						</td>
						<td id="urcp_hn_6" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="urcp_hv_6" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_6()" data-options="plain:true"></a>
						</td>
					</tr>
				</table>
			</div>
			<br/>
			<table id="table_unit_rcp" style="width:99%;height:88%" iconCls="icon-save"  rownumbers="false" pagination="false">
			</table>
			<div id="value_dlg" class="easyui-dialog" title="Values" style="width:180px;height:350px;padding:10px;"
				data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
					buttons: [{
						text:'OK',
						iconCls:'icon-ok',
						handler:function(){
							var selVal = $('#val_list').datalist('getSelected').text;
							setRecipeValue(selVal);
						}
					},{
						text:'Cancel',
						handler:function(){
							$('#value_dlg').dialog('close')
						}
					}]">
				<div>
				<div id="val_list" class="easyui-datalist" title="" lines="true" style="width:145px;height:250px;margin:auto"
					data-options="singleSelect:true">
				</div>
				</div>
			</div>
			<div id="header_value_dlg" class="easyui-dialog" title="RP Recipe" style="width:200px;height:350px;padding:10px;"
				data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
					buttons: [{
						text:'OK',
						iconCls:'icon-ok',
						handler:function(){
							var selVal = $('#header_val_list').datalist('getSelected').text;
							setRecipeHeaderValue(selVal);
						}
					},{
						text:'Cancel',
						handler:function(){
							$('#header_value_dlg').dialog('close')
						}
					}]">
				<div>
				<div id="header_val_list" class="easyui-datalist" title="" lines="true" style="width:165px;height:250px;margin:auto"
					data-options="singleSelect:true">
				</div>
				</div>
			</div>
			<div id="set_header_value_dlg" class="easyui-dialog" title="Set Recipe Header Value" style="width:330px;height:210px;padding:10px;"
				data-options="modal:true,closed:true,iconCls:'icon-save',
					buttons: [
						{text:'OK', iconCls:'icon-ok',handler:function(){
							var selVal = $('#input_nv').textbox('getText') // document.getElementById('input_nv').value
							console.log(selVal)
							set_header_value(selVal)
							$('#set_value_dlg').dialog('close')
						}},
						{text:'Cancel', handler:function(){
							$('#set_header_value_dlg').dialog('close')
						}}
					]">
				<div>
					<table style="width:290px" class="header_set_val_dlg_table">
						<tr>
							<td colspan="2" >
								<label id="header_var_name">name</label>
								<br/><br/>
							</td>
						</tr>
						<tr>
							<td width="145px"> Current Value: </td>
							<td>
								<input type="text" id="input_cv" class="easyui-textbox" value="{old value}" readonly="readonly" />
							</td>
						</tr>
						<tr height="4"></tr>
						<tr>
							<td> New Value: </td>
							<td>
								<input type="text" id="input_nv" class="easyui-textbox" value="" />
							</td>
						</tr>
					</table>
				</div>		
			</div>
		</div>
		<div id="window_pump_rcp" class="easyui-window" title="Recipe Editor"
			data-options="modal:true,closed:true,iconCls:'icon-help',cls:'c1'" style="width:850px;height:600px;padding:10px;">
			<div id="purcp_edit_btns" class="easyui-panel" style="padding:2px;" align="left">
				<a class="easyui-linkbutton" style="width:80px" onclick="on_ed_purcp_save()" data-options="iconCls:'icon-save', plain:true">Save</a>
			</div>
			<!-- <div style="float:left;width:300px;margin:10px">
				<table id="table_info" style="color:#cccccc;border:solid thin #cccccc">
					<tr>
						<td width="100">Create:</td>
						<td width="100">OEM-User</td>
						<td width="140">2018/04/24 16:26:22</td>
					</tr>
					<tr>
						<td>Last Update:</td>
						<td>OEM-User</td>
						<td>2018/06/13 09:39:14</td>
					</tr>
					<tr>
						<td>Last Update 2:</td>
						<td>OEM-User</td>
						<td>2018/06/13 09:37:50</td>
					</tr>
				</table>
			</div> -->
			<!-- <div style="float:right;width:450px;margin:10px">
				<table id="table_header">
					<tr height="27" style="padding-bottom:1px">
						<td id="purcp_hn_1" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="purcp_hv_1" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_1()" data-options="plain:true"></a>
						</td>
						<td id="purcp_hn_2" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="purcp_hv_2" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_2()" data-options="plain:true"></a>
						</td>
					</tr>
					<tr height="27" style="padding-bottom:1px">
						<td id="purcp_hn_3" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="purcp_hv_3" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_3()" data-options="plain:true"></a>
						</td>
						<td id="purcp_hn_4" width="102" align="right" style="padding-right:2px">							
						</td>
						<td width="118">
							<a id="purcp_hv_4" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_4()" data-options="plain:true"></a>
						</td>
					</tr>
					<tr height="27" style="padding-bottom:1px">
						<td id="purcp_hn_5" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="purcp_hv_5" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_5()" data-options="plain:true"></a>
						</td>
						<td id="purcp_hn_6" width="102" align="right" style="padding-right:2px">
						</td>
						<td width="118">
							<a id="purcp_hv_6" class="easyui-linkbutton c4" style="width:115px" onclick="on_header_edit_6()" data-options="plain:true"></a>
						</td>
					</tr>
				</table>
			</div> -->
			<br/>
			<table id="table_pump_rcp" style="width:99%;height:88%" iconCls="icon-save"  rownumbers="false" pagination="false">
			</table>

			<!-- 20190624 start
				a recipe select dialog.
				TODO: implement by JS.
			 -->
			<div id="rcp_select_dlg" class="easyui-dialog" title="Select a recipe: " style="width:400px;height:410px;padding:10px;"
			 	data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
				 buttons: [{
					 text:'OK',
					 iconCls:'icon-ok',
					 handler:function() {
						row = $('#rcp_select_tg').treegrid('getSelected')
						if (row == null || row.children != undefined) {
							$.messager.alert('Tips', 'Select a recipe file please.', 'info')
							return
						}
						var path_name = getFullPathName(rcp_select_tg, row.name, row.id)
						path_name = path_name.substr(5) // trim the 'pump/', to be optimized
						console.log(path_name)
						if (g_head_edit_pump == false){
						if (g_enum_pump_rcp_dlg_ok_handler != null)
							g_enum_pump_rcp_dlg_ok_handler(path_name)
						}
						else{
						if (g_head_edit_pump_dlg_ok_handler != null)
							g_head_edit_pump_dlg_ok_handler(path_name)
						}
					 }
				 },{
					 text:'Cancel',
					 handler:function(){
						 $('#rcp_select_dlg').dialog('close')
					 }
				 }]">
				<div>
					<table id='rcp_select_tg'
						title="" class="easyui-treegrid" style="width:100%;height:300px">
						<thead>
							<tr>
								<th data-options="field:'name'" width="60%">Name</th>
								<th data-options="field:'detail'" width="40%">Detail</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
			<!-- 20190624 end -->

			<!-- 20190613 start
				a common enum value setting dialog.
				TODO: implement by JS.
			 -->
			<div id="enum_value_dlg" class="easyui-dialog" title="Values" style="width:180px;height:350px;padding:10px;"
				data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
					buttons: [{
						text:'OK',
						iconCls:'icon-ok',
						handler:function() {
							var selRow = $('#enum_val_list').datalist('getSelected')
							var rowIndex = $('#enum_val_list').datalist('getRowIndex', selRow)
							if (g_enum_val_dlg_ok_handler != null)
								g_enum_val_dlg_ok_handler(selRow.text, rowIndex)
						}
					},{
						text:'Cancel',
						handler:function(){
							$('#enum_value_dlg').dialog('close')
						}
					}]">
				<div>
				<div id="enum_val_list" class="easyui-datalist" title="" lines="true" style="width:145px;height:250px;margin:auto"
					data-options="singleSelect:true">
				</div>
				</div>
			</div>
			<div id="input_value_dlg" class="easyui-dialog" title="Values" style="width:280px;height:250px;padding:10px;"
					data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
				buttons: [{
					text:'OK',
					iconCls:'icon-ok',
					handler:function() {
						if (g_input_val_dlg_ok_handler != null) {
							var setVal = $('#input_val_box').textbox('getText')
							g_input_val_dlg_ok_handler(setVal)
						}
					}
				},{
					text:'Cancel',
					handler:function(){
						$('#input_value_dlg').dialog('close')
					}
				}]">
				<div>
					<div id="input_val_box" class="easyui-textbox" label="Input new Value:" labelPosition="top" style="width:100%;margin-bottom:10px"></div>
					<div id="input_lowlimit" class="easyui-textbox" label="Min Limit" labelPosition="left" style="width:100%;" data-options="readonly:true"></div>
					<div id="input_uplimit" class="easyui-textbox" label="Max Limit" labelPosition="left" style="width:100%;" data-options="readonly:true"></div>
				</div>
			</div>
			<!-- 20190613 end -->
			
			<div id="pump_value_dlg" class="easyui-dialog" title="Values" style="width:180px;height:350px;padding:10px;"
				data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
					buttons: [{
						text:'OK',
						iconCls:'icon-ok',
						handler:function(){
							var selVal = $('#pump_val_list').datalist('getSelected').text;
							setRecipeValue1(selVal);
						}
					},{
						text:'Cancel',
						handler:function(){
							$('#pump_value_dlg').dialog('close')
						}
					}]">
				<div>
				<div id="pump_val_list" class="easyui-datalist" title="" lines="true" style="width:145px;height:250px;margin:auto"
					data-options="singleSelect:true">
				</div>
				</div>
			</div>
			<div id="header_value_dlg" class="easyui-dialog" title="RP Recipe" style="width:200px;height:350px;padding:10px;"
				data-options="modal:true, closed:true, iconCls:'icon-save', cls:'c7',
					buttons: [{
						text:'OK',
						iconCls:'icon-ok',
						handler:function(){
							var selVal = $('#header_val_list').datalist('getSelected').text;
							setRecipeHeaderValue(selVal);
						}
					},{
						text:'Cancel',
						handler:function(){
							$('#header_value_dlg').dialog('close')
						}
					}]">
				<div>
				<div id="header_val_list" class="easyui-datalist" title="" lines="true" style="width:165px;height:250px;margin:auto"
					data-options="singleSelect:true">
				</div>
				</div>
			</div>
			<div id="set_header_value_dlg" class="easyui-dialog" title="Set Recipe Header Value" style="width:330px;height:210px;padding:10px;"
				data-options="modal:true,closed:true,iconCls:'icon-save',
					buttons: [
						{text:'OK', iconCls:'icon-ok',handler:function(){
							var selVal = $('#input_nv').textbox('getText') // document.getElementById('input_nv').value
							console.log(selVal)
							set_header_value(selVal)
							$('#set_value_dlg').dialog('close')
						}},
						{text:'Cancel', handler:function(){
							$('#set_header_value_dlg').dialog('close')
						}}
					]">
				<div>
					<table style="width:290px" class="header_set_val_dlg_table">
						<tr>
							<td colspan="2" >
								<label id="header_var_name">name</label>
								<br/><br/>
							</td>
						</tr>
						<tr>
							<td width="145px"> Current Value: </td>
							<td>
								<input type="text" id="input_cv" class="easyui-textbox" value="{old value}" readonly="readonly" />
							</td>
						</tr>
						<tr height="4"></tr>
						<tr>
							<td> New Value: </td>
							<td>
								<input type="text" id="input_nv" class="easyui-textbox" value="" />
							</td>
						</tr>
					</table>
				</div>		
			</div>
		</div>
	</div>
</body>

</html>
